Skip to content

fix: resolve all failing tests and type errors across monorepo#1

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2414-1779432554
Open

fix: resolve all failing tests and type errors across monorepo#1
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2414-1779432554

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all 13 failing tests and eliminates all TypeScript type errors in this multi-package monorepo.

Changes

packages/utils/src/format/date.ts

  • Fixed date formatting utility to use the correct locale and format string expected by tests

packages/utils/src/hooks/apps/web/src/lib/api.ts

  • Updated import from renamed useThrottle to useDebounce (hook was renamed in utils but consumers still referenced the old name)
  • Added useSearchDebounce re-export alias expected by the web app's test suite

packages/ui/src/components/Button/Button.tsx

  • Fixed stale closure bug by stabilizing the onClick handler reference (caught by controlled re-render test)

packages/ui/src/components/DataTable/DataTable.tsx

  • Added required aria-label accessibility attribute expected by the DataTable test

Configuration

  • Configured happy-dom test environment in bunfig.toml for UI package tests (document is not defined)
  • Added bun-types to tsconfig.json to resolve bun:test type declarations

Verification

bun test → 13 pass, 0 fail, 17 expect() calls
npx tsc --noEmit → EXIT_CODE=0

Assumptions

  • The bun:test type resolution was fixed via tsconfig rather than adding a new dependency
  • happy-dom was already available in node_modules (no new dependency added)
  • Test files were not modified per requirements

- Rename useThrottle → useDebounce import in apps/web/src/lib/api.ts and
  export useSearchDebounce alias to match test expectations
- Fix Button component to use useCallback for stable onClick reference
  (stale closure bug caught by re-render test)
- Add aria-label to DataTable component as required by accessibility test
- Fix date formatting utility to use correct locale/format string
- Configure bun test environment (happy-dom) for UI package tests
- Add bun-types to tsconfig to resolve bun:test type errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant